package _1010.funcref;

import org.junit.Test;

public class SpecialRefDemo {

	interface M{
		int withDeal(String t1,String t2);
	}
	
	interface M2<T,R>{
		T withDeal(T t1,R r);
	}
	
	@Test
	public void t1() {
		M m = String::indexOf;   // int indexOf(String str)
		System.out.println(m.withDeal("hello", "l")); // "hello".indexOf("l");
		
		M2<String,Integer> m2 = String::substring;
		System.out.println(m2.withDeal("hello world", 3)); // "hello world".substring(3);
	}
}
